package lu.med.praxiswahl.wahlumed.client.patienten;

import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 * 
 * @author Lars Holger Roth
 */
public class PatientOrdonancenActionListener implements ListSelectionListener
{
    private PatientenPanel model;
    private int mode;
    public static final int MODE_LABOR = 0;
    public static final int MODE_UEBERWEISUNG = 1;
    public static final int MODE_REZEPT = 2;

    public PatientOrdonancenActionListener(PatientenPanel model, int mode)
    {
	this.model = model;
	this.mode = mode;
    }

    public void valueChanged(ListSelectionEvent e)
    {
	if (model == null)
	    return;
	switch (mode)
	{
	case MODE_LABOR:
	    model.viewLabor();
	    break;
	case MODE_UEBERWEISUNG:
	    model.viewUeberweisung();
	    break;
	case MODE_REZEPT:
	    model.viewRezept();
	    break;
	}
    }

}
